package com.young.springdemo.service.observerPattern;


import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class testObserver {

//    @PostConstruct
    public void testO(){
        AllyControllerCenter allyControllerCenter = new ConcreateAlly("武林联盟");
        Observer play = new Player("张三");
//        play.setName("张三");
        Observer player = new Player("李四");
//        player.setName("李四");
        Observer playe = new Player("王五");
//        playe.setName("王五");


        allyControllerCenter.join(play);
        allyControllerCenter.join(playe);
        allyControllerCenter.join(player);

        play.beAttacked(allyControllerCenter);
    }
}
